﻿using FluentNHibernate.Mapping;
using FluentNH_DO.Entities;

namespace FluentNH_DAL.Mappings
{
    public sealed class ContactMap: ClassMap<Contact>
    {
        public ContactMap()
        {
            Table("Test_Contact");
            Id(x => x.Id);
            Map(x => x.Name).Not.Nullable().Length(40).Unique();
            HasMany(x => x.ContactInfos)
                .Cascade.All()
                .LazyLoad();
        }
    }
}
